//
//  GiftTableViewCell.m
//  GameBaby
//
//  Created by keyZhang on 13-12-27.
//  Copyright (c) 2013年 keyZhang. All rights reserved.
//

#import "GiftTableViewCell.h"
#import "GiftCellModel.h"

@implementation GiftTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [self.headImg setImageWithURL:[NSURL URLWithString:self.model.litpic]];
    self.titleLabel.text = self.model.title;
    self.ka_numLabel.text = [NSString stringWithFormat:@"礼包剩余 %@ 个",self.model.ka_num];
    if ([self.model.is_integral intValue] == 0) {
        self.jfImgView.hidden = YES;
    }else
    {
        self.jfImgView.hidden = NO;
    }
    
    NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"YYYY-MM-dd"];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:[self.model.time doubleValue]];
    self.timeLabel.text = [NSString stringWithFormat:@"发号日期:%@",[formatter stringFromDate:date]];
    
}


@end
